Package text

Functions

Link copied to clipboard
fun String.capitalized(): String

It makes a copy of a string with the first character converted to uppercase.

Link copied to clipboard
fun String.count(substring: String): Int

It counts the occurrences of a given substring in a text.

Link copied to clipboard
fun String.delete(vararg substrings: String): String

It makes a copy of the string with all occurrences the matching substrings arguments deleted.

Link copied to clipboard
operator fun String.get(indices: Iterable<Int>): String

It simplifies the slicing of a string using the bracket notation.

operator fun String.get(indices: IntRange): String
Link copied to clipboard
fun String.insert(index: Int, otherString: String): String

It inserts the given otherString into this string at the specified index.

Link copied to clipboard
fun String.swapcase(): String

It makes a copy of a string with uppercase alphabetic characters converted to lowercase and lowercase characters converted to uppercase. The case of non-alphabetic characters is not changed.

Link copied to clipboard
operator fun String.times(n: Int): String

It simplifies the repetition of a string using the times(*) operator.